package vip.source.pattern.part09.improve;

import org.junit.jupiter.api.Test;
import vip.source.pattern.part09.base.service.impl.SsoInterceptor;

/**
 * @Description: 装饰器测试
 * @Author: zy
 **/
public class UnitTest {
    @Test
    public void test_LoginSsoDecorator() {
        LoginSsoDecorator ssoDecorator = new LoginSsoDecorator(new SsoInterceptor());
        String request = "1successhuahua";
        boolean success = ssoDecorator.preHandle(request, "ewcdqwt40liuiu", "t");
        System.out.println("登录校验：" + request + (success ? " 放行" : " 拦截"));
    }
}
